var submitFrom = "";

function validateForm()
{     
   var mininumCharMsg = "Please enter a minimum of 3-character value.  Wildcard * is supported.  (e.g. D12 or M12*)";
   
   var equipment = trim(document.getElementById("txtEquipment").value);
   document.getElementById("txtEquipment").value = equipment; 
   
   if ( equipment.length < 3 && submitFrom == "Query" ) {
      alert( mininumCharMsg );         
      document.getElementById("txtEquipment").focus();
      isFromAlertWindow = true;  // Work around for Mozilla bug.
      return false;
   }   
   else if ( equipment.length == 3 && submitFrom == "Query" ) {
      if ( equipment.indexOf("*") > -1 ) {
         alert( "Please enter a minimum of 3-character value excluding the wildcard *.  (e.g. D12 or M12*)" );         
         document.getElementById("txtEquipment").focus();
         isFromAlertWindow = true;  // Work around for Mozilla bug.
         return false;
      }
   }
   else if ( submitFrom == "Cancel" ) {
      return false; 
   }
}


function handleEquipSelect(obj)
{
   parentEQField = window.opener.document.getElementById("txtEquipment");                                        
   parentEQField.value = escape(obj.firstChild.data)=='%A0'?'':obj.firstChild.data;  
   parentEQCat = window.opener.document.getElementById("selectedEquipCategory");
   // remove the filter for BP11.0
   self.close();
   window.opener.document.getElementById("btnQuery").focus();
}


